import request from '@/utils/request'

// 登录
export function loginApi(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}
// 获取用户信息
export function getUserInfoApi() {
  return request({
    url: '/sys/profile',
    method: 'post'
  })
}
// 获取员工详情
export function getUserDetailByIdApi(id) {
  return request({
    url: '/sys/user/' + id,
    method: 'get'
  })
}

// 批量导入员工
export function importExcel(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}

/** *
 *  读取用户详情的基础信息
 * **/
export function getPersonalDetail(id) {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}

/** *
 *  更新用户详情的基础信息
 * **/
export function updatePersonal(data) {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}

